package cn.memorynine.consumer.controller;

import cn.memorynine.consumer.model.donation.manage.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import cn.memorynine.common.model.ResponseWrapper;
import cn.memorynine.consumer.service.DonationManageService;
import cn.memorynine.common.model.ResponseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;

/**
* 管理后台-捐赠管理控制器
* @author 代码生成器
*/
@Slf4j
@RestController
@RequestMapping("/admin/donationManage")
public class DonationManageController {
    @Autowired
    private DonationManageService donationManageService;

    /**
     * 1.查看捐赠列表
     * @return
     */
    @RequestMapping("/donationList")
    public ResponseWrapper donationList(@RequestBody @Validated DonationListParam param){
        return donationManageService.donationList(param);
    }

    /**
     * 2.新增/修改 捐赠记录
     * @return
     */
    @RequestMapping("/saveDonation")
    public ResponseWrapper saveDonation(@RequestBody @Validated SaveDonationParam param){
        return donationManageService.saveDonation(param);
    }

    /**
     * 3.修改/新增 捐赠记录-获取捐赠记录信息
     * @return
     */
    @RequestMapping("/donationInfo")
    public ResponseWrapper donationInfo(@RequestBody @Validated DonationInfoParam param){
        return donationManageService.donationInfo(param);
    }

    /**
     * 4.获取用户信息
     * @return
     */
    @RequestMapping("/consumerList")
    public ResponseWrapper consumerList(@RequestBody @Validated ConsumerListParam param){
        return donationManageService.consumerList(param);
    }

}